package com.xueyi.game.backend.service;


import com.xueyi.core.base.TableData;
import com.xueyi.core.expection.BusinessException;
import com.xueyi.game.backend.entity.dto.BaseUserLoginDto;
import com.xueyi.game.backend.entity.dto.FindUserLogByUserIdDto;
import com.xueyi.game.backend.entity.dto.SaveBaseUserDto;
import com.xueyi.game.backend.entity.dto.UserTableDto;
import com.xueyi.game.backend.entity.po.BaseUser;
import com.xueyi.game.backend.entity.vo.MenuListVo;
import com.xueyi.game.backend.entity.vo.UserLoginVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 描述 后台用户的Service
 *
 * @auther 俞烨
 * @date 2022-11-08 15
 */
public interface IBackendAccountService {

    /**
     * 用户登录
     *
     * @param baseUserLoginDto
     * @param request
     * @return
     */
    UserLoginVo<?> userLogin(BaseUserLoginDto baseUserLoginDto,
                             HttpServletRequest request) throws BusinessException;


    /**
     * 清空用户的缓存信息
     *
     * @param userId
     */
    void clearUserCache(Integer userId);

    /**
     * 添加用户
     *
     * @param saveBaseUserDto
     */
    void save(SaveBaseUserDto saveBaseUserDto) throws BusinessException;

    /**
     * 通过用户id查询用户的信息
     *
     * @param userId
     * @return
     */
    BaseUser findUserById(Integer userId) throws BusinessException;

    /**
     * 编辑用户
     *
     * @param saveBaseUserDto
     */
    void edit(SaveBaseUserDto saveBaseUserDto) throws BusinessException;

    /**
     * 删除或者恢复用户的使用
     *
     * @param userId
     * @param currentStatus
     */
    void delOrRecover(Integer userId, Integer currentStatus);

    /**
     * 查询用户的集合
     *
     * @param userTableDto
     * @return
     */
    TableData<?> findUserList(UserTableDto userTableDto);

    /**
     * 查用户的菜单集合
     * @return
     */
    List<MenuListVo> findUserMenuVo();

    /**
     * 获取用户操作日志lieb
     *
     * @param findUserLogByUserIdDto
     * @return
     * @author hxs
     */
    TableData<?> findUserLogByUserId(FindUserLogByUserIdDto findUserLogByUserIdDto);
}
